package cn.stylefeng.guns.modular.business.frequency.financesettlementimage.controller;

import cn.stylefeng.guns.core.annotion.BusinessLog;
import cn.stylefeng.guns.core.enums.LogAnnotionOpTypeEnum;
import cn.stylefeng.guns.core.pojo.response.ResponseData;
import cn.stylefeng.guns.core.pojo.response.SuccessResponseData;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import cn.stylefeng.guns.modular.business.frequency.financesettlementimage.service.FinanceSettlementImageService;
import cn.stylefeng.guns.modular.business.frequency.financesettlementimage.model.param.FinanceSettlementImageParam;

import javax.annotation.Resource;

/**
 * 订单财务结算图片 控制器
 *
 * @author: yujie
 * @date: 2023/05/09 17:17
 */
@RestController
public class FinanceSettlementImageController {

    @Resource
    private FinanceSettlementImageService financeSettlementImageService;

    /**
     * 分页查询订单财务结算图片
     *
     * @author yujie
     * @date 2023/05/09 17:17
     */
    @GetMapping("/financeSettlementImage/page")
    @BusinessLog(title = "订单财务结算图片_分页查询", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData page(FinanceSettlementImageParam financeSettlementImageParam) {
        return new SuccessResponseData(financeSettlementImageService.page(financeSettlementImageParam));
    }

    /**
     * 获取全部订单财务结算图片
     *
     * @author yujie
     * @date 2023/05/09 17:17
     */
    @GetMapping("/financeSettlementImage/list")
    @BusinessLog(title = "订单财务结算图片_查询所有", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData list(FinanceSettlementImageParam financeSettlementImageParam) {
        return new SuccessResponseData(financeSettlementImageService.list(financeSettlementImageParam));
    }

    /**
     * 查看详情订单财务结算图片
     *
     * @author yujie
     * @date 2023/05/09 17:17
     */
    @GetMapping("/financeSettlementImage/detail")
    @BusinessLog(title = "订单财务结算图片_查看详情", opType = LogAnnotionOpTypeEnum.DETAIL)
    public ResponseData detail(@Validated(FinanceSettlementImageParam.detail.class) FinanceSettlementImageParam financeSettlementImageParam) {
        return new SuccessResponseData(financeSettlementImageService.detail(financeSettlementImageParam));
    }

    /**
     * 添加订单财务结算图片
     *
     * @author yujie
     * @date 2023/05/09 17:17
     */
    @PostMapping("/financeSettlementImage/add")
    @BusinessLog(title = "订单财务结算图片_增加", opType = LogAnnotionOpTypeEnum.ADD)
    public ResponseData add(@RequestBody @Validated(FinanceSettlementImageParam.add.class) FinanceSettlementImageParam financeSettlementImageParam) {
        financeSettlementImageService.add(financeSettlementImageParam);
        return new SuccessResponseData();
    }

    /**
     * 删除订单财务结算图片
     *
     * @author yujie
     * @date 2023/05/09 17:17
     */
    @PostMapping("/financeSettlementImage/delete")
    @BusinessLog(title = "订单财务结算图片_删除", opType = LogAnnotionOpTypeEnum.DELETE)
    public ResponseData delete(@RequestBody @Validated(FinanceSettlementImageParam.delete.class) FinanceSettlementImageParam financeSettlementImageParam) {
        financeSettlementImageService.delete(financeSettlementImageParam);
        return new SuccessResponseData();
    }

    /**
     * 编辑订单财务结算图片
     *
     * @author yujie
     * @date 2023/05/09 17:17
     */
    @PostMapping("/financeSettlementImage/edit")
    @BusinessLog(title = "订单财务结算图片_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
    public ResponseData edit(@RequestBody @Validated(FinanceSettlementImageParam.edit.class) FinanceSettlementImageParam financeSettlementImageParam) {
        financeSettlementImageService.edit(financeSettlementImageParam);
        return new SuccessResponseData();
    }


}
